#ifndef __HD44780_INTERFACE_H__
#define __HD44780_INTERFACE_H__

#ifndef __HD44780_INSTRUCTIONS_H__
	#error "This file is only used by hd44780_api.h"
#endif

/* bits( E , RS and R/W ) used by instruction register of HD44780 Compatible Display */
#define BIT_E  			b3
#define BIT_E_ENABLE		1
#define BIT_E_DISABLE		0
#define BIT_E_SET( CTL , STAT )	\
	CTL.bits.BIT_E = STAT ;

#define BIT_RS 			b4
#define BIT_RS_INSTRUCTION 	0 
#define BIT_RS_DATA 		1
#define BIT_RS_SET( CTL , STAT )\
	CTL.bits.BIT_RS = STAT ;

#define BIT_RW 			b5
#define BIT_RW_READ 		1
#define BIT_RW_WRITE		0
#define BIT_RW_SET( CTL , STAT )\
	CTL.bits.BIT_RW = STAT ;

/* bits of direction instruction register
(these bits are used to control read/write from/to instruction register bits) */
#define BIT_D_E  		b3
#define BIT_D_E_READ		0
#define BIT_D_E_WRITE		1
#define BIT_D_E_SET( CTL , STAT )\
	CTL.bits.BIT_D_E = STAT ;

#define BIT_D_RS 		b4
#define BIT_D_RS_READ	 	0 
#define BIT_D_RS_WRITE 		1
#define BIT_D_RS_SET( CTL , STAT )\
	CTL.bits.BIT_D_RS = STAT ;

#define BIT_D_RW 		b5
#define BIT_D_RW_READ		0
#define BIT_D_RW_WRITE 		1
#define BIT_D_RW_SET( CTL , STAT )\
	CTL.bits.BIT_D_RW = STAT ;

#endif
